package com.leon.document_auto_generation_tool.entity;

/**
 * @author XiaoZeguang
 * @creatTime 2023-04-21
 * 响应实体类
 */
public class RespBean {
    private String code;
    private String msg;
    private Object data;

    public static RespBean success(String msg) {
        return new RespBean("0000", msg, null);
    }

    public static RespBean success(String msg, Object obj) {
        return new RespBean("0000", msg, obj);
    }

    public static RespBean error(String msg) {
        return new RespBean("2001", msg, null);
    }

    public static RespBean error(String msg, Object obj) {
        return new RespBean("2001", msg, obj);
    }

    private RespBean() {
    }

    private RespBean(String code, String msg, Object obj) {
        this.code = code;
        this.msg = msg;
        this.data = obj;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }
}
